home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #define OPENFRAMES 14 /* number of keyframes to open the book */
- #define COVERSEGS 2 /* number of horizontal segments for cover */
- #define BINDINGSEGS 4 /* number of horizontal segments for binding */
- #define TWOD 2 /* these are 2D arrays */
- #define SCALE (1.0/96000.0) /* 2D data is 96000 units/inch */
- #define COVEROVERHANG 0.25 /* Cover overhang beyond pages (1/4") */
- #define PGHT 10.0 /* Page height is 10" */
- #define ROTINC 10
- #define CLOCKWISE 1
- #define COUNTER_CLOCKWISE -1
-
- /* This is the 2d array of keyframes for right side pages of the opening book.
- The opening book is symmetrical around the binding, so we just mirror them
- for the left side. NOTE:openpg[0] is the open book and openpg[13] is the
- closed book */
-
- float openpg[OPENFRAMES][PGSEGS][TWOD] = {
- {{0,0},{173426,82387},{364780,98117},{554375,67827},{744279,39553},
- {935809,26124}},
- {{0,0},{168819,91456},{359800,111206},{549852,83925},{740180,58665},
- {932039,51347}},
- {{0,0},{162728,101900},{353385,124581},{544101,102442},{735043,82328},
- {926981,77478}},
- {{0,0},{155124,113139},{343982,147742},{534895,127377},{726016,109038},
- {917991,105973}},
- {{0,0},{146425,124193},{332000,173444},{523178,155700},{714314,137537},
- {906303,139736}},
- {{0,0},{136069,135461},{317130,199336},{509115,196876},{701090,193993},
- {892294,211477}},
- {{0,0},{125072,145678},{297500,230124},{488241,252076},{680105,259223},
- {870362,285071}},
- {{0,0},{111858,156054},{271824,262231},{458304,307942},{646857,344144},
- {830221,401093}},
- {{0,0},{96285,166114},{244582,288062},{423182,358531},{602074,428254},
- {771173,519191}},
- {{0,0},{77075,175852},{207969,315963},{365236,426105},{521439,537749},
- {666004,664103}},
- {{0,0},{56103,183622},{160176,344967},{280074,494929},{391933,650978},
- {494182,813485}},
- {{0,0},{30763,189521},{95152,370402},{178804,543220},{253268,720191},
- {316929,901329}},
- {{0,0},{10423,191718},{123862,756196},{156985,945315},{83805,568421},
- {123862,756196}},
- {{0,0},{0,192000},{0,384000},{0,576000},{0,768000},{0,960000}}
- };
-
- /* This is the 2d array of keyframes for right side cover of the opening book.
- The opening book is symmetrical around the binding, so we just mirror them
- for the left side */
- static float opencover[OPENFRAMES][COVERSEGS][TWOD] = {
- {{96000,-48000},{1128000,-48000}},
- {{96000,-48000},{1127681,-22376}},
- {{96000,-48000},{1126370,9993}},
- {{96000,-48000},{1123459,48706}},
- {{96000,-48000},{1117578,98297}},
- {{96000,-48000},{1103087,177387}},
- {{96000,-48000},{1080481,261551}},
- {{96000,-48000},{1026808,397669}},
- {{96000,-48000},{951516,529162}},
- {{96000,-48000},{825999,681469}},
- {{96000,-48000},{635555,831718}},
- {{96000,-48000},{443958,923570}},
- {{96000,-48000},{267760,969606}},
- {{96000,-48000},{96000,984000}},
- };
-
- /* These are the coordinates for the binding. This is the weakes part of the
- book right now. It needs to be animated more (maybe a bevel or curve) */
- static float binding[BINDINGSEGS][TWOD] =
- {{-96000,-48000},{-76000,-64000},{76000,-64000},{96000,-48000}};
-
- /* This is the 2d array of keyframes for the turning a page from right to left.
- Just mirror this around the binding (y=0) to turn pages from left to right.
- NOTE:openpg[0] is the right open book page and openpg[13] is the left open
- book page */
- static float turnpg[TURNFRAMES][PGSEGS][TWOD] = {
- {{0,0},{173426,82387},{364780,98117},{554375,67827},
- {744279,39553},{935809,26124}},
- {{0,0},{158666,108118},{349528,128984},{537420,89485},
- {725720,51984},{916739,32596}},
- {{0,0},{129655,141612},{319613,169529},{505392,121051},
- {691062,72165},{880870,43234}},
- {{0,0},{85155,172086},{267046,233552},{450736,177671},
- {629554,107766},{815870,61383}},
- {{0,0},{29916,189657},{173227,317427},{363453,291389},
- {534070,203333},{709434,125160}},
- {{0,0},{-27423,190033},{77439,350866},{260511,408735},
- {445618,357754},{610599,259544}},
- {{0,0},{-77784,175539},{-38022,363375},{103241,493409},
- {290813,534407},{481520,512174}},
- {{0,0},{-112510,155582},{-145034,344806},{-87895,528107},
- {52574,658995},{235849,716215}},
- {{0,0},{-136781,134740},{-244756,293501},{-276208,482908},
- {-237636,670991},{-161282,847155}},
- {{0,0},{-149782,120123},{-297873,242321},{-424883,386308},
- {-545678,535546},{-664298,686520}},
- {{0,0},{-160934,104710},{-333717,188437},{-517937,242538},
- {-708455,265073},{-900316,272322}},
- {{0,0},{-167446,93947},{-351424,148871},{-543117,138061},
- {-733853,116088},{-925009,98113}},
- {{0,0},{-171372,86580},{-360364,120437},{-550633,94730},
- {-740244,64551},{-931488,47528}},
- {{0,0},{-173426,82387},{-364780,98117},{-554375,67827},
- {-744279,39553},{-935809,26124}},
- };
-
-
- static float ropenpg[OPENFRAMES][PGSEGS][VPGSEGS][THREED]; /* left and right array of */
- float lopenpg[OPENFRAMES][PGSEGS][VPGSEGS][THREED]; /* pages to open book */
-
- static float ropenbasepg[OPENFRAMES][3][2][THREED]; /* pages next to cover for filling */
- float lopenbasepg[OPENFRAMES][3][2][THREED]; /* in side pages */
-
- static float sbinding[BINDINGSEGS][2][3]; /* back side of book */
-
- static float ropencover[OPENFRAMES][COVERSEGS][2][THREED]; /* cover for book */
- static float lopencover[OPENFRAMES][COVERSEGS][2][THREED];
-
- static float rtolpglst[TURNFRAMES][PGSEGS][VPGSEGS][THREED];
- static float ltorpglst[TURNFRAMES][PGSEGS][VPGSEGS][THREED];
-
- static float crackvtx[2][THREED]; /* crack between left and right pages */
-
- static float sqrttable[4000];
-
- static float rtolnorm[TURNFRAMES][PGSEGS][VPGSEGS][3];
- static float ltornorm[TURNFRAMES][PGSEGS][VPGSEGS][3];
-
- static float pgcolor[3] = {1.0,1.0,1.0}; /* white */
- static float crackcolor[3] = {0.45,0.45,0.45}; /* gray */
- static float pgedgecolor[3] = {1.0,1.0,0.0}; /* yellow */
- static float covercolor[3] = {1.0,0.0,0.0}; /* red */
-